#!/usr/bin/env python
# -*- coding: utf-8 -*-

# @Time     :2020/11/18
# @Author   :Changshu
# @File     :Exercise_453.py
# 453. 最小移动次数使数组元素相等

# n-1个元素加1，相当于一个元素减1，但每个元素最多只能减到与最小值相同

def minMoves(nums: list) -> int:
	m=min(nums)
	s=0
	for n in nums:
		s+=(n-m)
	return s

if __name__ == '__main__':
	nums=[1,2,3]
	print(minMoves(nums))